package com.gitee.wsl.mathematics.vector.ext

import com.gitee.wsl.mathematics.vector.Vector
import com.gitee.wsl.mathematics.vector.vec2.Vector2
import com.gitee.wsl.mathematics.vector.vec3.Vector3
import com.gitee.wsl.mathematics.vector.vec4.Vector4

/*
operator fun<T:Number,K: Vector2<T, *>> Vector2<T, *>.plus(other: K) = other.create(x + other.x, y + other.y)
operator fun<T:Number,K: Vector3<T, *>> Vector2<T, *>.plus(other: K) = other.create(x + other.x, y + other.y, other.z)
operator fun<T:Number,K: Vector4<T, *>> Vector2<T, *>.plus(other: K) = other.create(x + other.x, y + other.y, other.z, other.w)
*/

/*
operator fun<T:Number> Vector3<T, *>.plus(other: Vector2<T, *>) =       create(x + other.x, y + other.y, z)
operator fun<T:Number> Vector3<T, *>.plus(other: Vector3<T, *>) = other.create(x + other.x, y + other.y, z + other.z)
operator fun<T:Number> Vector3<T, *>.plus(other: Vector4<T, *>) = other.create(x + other.x, y + other.y, z + other.z, other.w)
*/

/*
operator fun<T:Number,K: Vector2<T, *>> Vector4<T, *>.plus(other: K) = create(x + other.x, y + other.y, z, w)
operator fun<T:Number,K: Vector3<T, *>> Vector4<T, *>.plus(other: K) = create(x + other.x, y + other.y, z + other.z, w)
operator fun<T:Number,K: Vector4<T, *>> Vector4<T, *>.plus(other: K) = create(x + other.x, y + other.y, z + other.z, w + other.w)
*/

//operator fun<T:Number,K: Vector<T, K>> K.plus(other: Number):K = create(proxy.map{ i ->  i + other  })
operator fun<T:Number,K: Vector<T, K>> Number.plus(other: K):K = other.plusBy(this)

operator fun<T:Number,K: Vector2<T, K>> Vector2<T, *>.plus(other: K):K = other.create(x + other.x, y + other.y)
operator fun<T:Number,K: Vector3<T, K>> Vector2<T, *>.plus(other: K):K = other.create(x + other.x, y + other.y, other.z)
operator fun<T:Number,K: Vector4<T, K>> Vector2<T, *>.plus(other: K):K = other.create(x + other.x, y + other.y, other.z, other.w)

operator fun<T:Number,V: Vector3<T, V>> Vector3<T, V>.plus(other: Vector2<T, *>) =       create(x + other.x, y + other.y, z)
operator fun<T:Number,K: Vector3<T, K>> Vector3<T, *>.plus(other: K):K = other.create(x + other.x, y + other.y, z + other.z)
operator fun<T:Number,K: Vector4<T, K>> Vector3<T, *>.plus(other: K):K = other.create(x + other.x, y + other.y, z + other.z, other.w)


operator fun<T:Number,V: Vector4<T, V>> Vector4<T, V>.plus(other: Vector2<T, *>) = create(x + other.x, y + other.y, z, w)
operator fun<T:Number,V: Vector4<T, V>> Vector4<T, V>.plus(other: Vector3<T, *>) = create(x + other.x, y + other.y, z + other.z, w)
operator fun<T:Number,V: Vector4<T, V>> Vector4<T, V>.plus(other: Vector4<T, *>) = create(x + other.x, y + other.y, z + other.z, w + other.w)
